<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/31
 * Time: 16:25
 */

namespace app\console\behavior;


use think\Controller;
use think\Session;
use think\Db;
use think\View;

class AudingStatus extends Controller
{

    public function run($data)
    {
        $manage_id = Db::name('manager')->where('id', Session::get('manage_id'))->value('level');
        $manage_id = Db::name('manager')->where('id', Session::get('manage_id'))->value('level');
        $auding_status = Db::name('auth_group')->where('id', $manage_id)->value('auding_status');//默认1没有审核权限
        View::instance()->share('auding_status', $auding_status);
        $web_tyre = Db::name('config')->where('varname', 'web_tyre')->value('varvalue');
        $this->assign('web_tyre', $web_tyre);

        if (session('auding_status') == 1) {
            $where['shop_id'] = ['eq', session('shop_id')];
        } else {
            $where = [];
        }
        $count = Db::name('service')->where($where)->where('is_read_shop', 1)->count();
        $this->assign('service_read', $count);

    }


}